﻿using System.ComponentModel;
using CommonLibrary.Helpers;
using FileLibrary.Enums;

namespace FileLibrary.Models
{
    [Description("检修规范")]
    public class MaintenanceProgram : FileModel
    {
        private string trackTypeEnumStr;

        private TrackTypeEnum trackTypeEnum;

        private string maintenanceEnumStr;

        private MaintenanceEnum maintenanceEnum;

        [Description("作业包名称")]
        public string MaintenanceEnumStr
        {
            get { return maintenanceEnumStr; }
            set
            {
                maintenanceEnumStr = value;
                maintenanceEnum = maintenanceEnumStr.Parse<MaintenanceEnum>();
            }
        }

        [Description("检修耗时")]
        public int Time { get; set; }

        [Description("股道种类")]
        public string TrackTypeEnumStr
        {
            get { return trackTypeEnumStr; }
            set
            {
                trackTypeEnumStr = value;
                trackTypeEnum = trackTypeEnumStr.Parse<TrackTypeEnum>();
            }
        }

        public MaintenanceEnum MaintenanceEnum => maintenanceEnum;
        public TrackTypeEnum TrackTypeEnum => trackTypeEnum;
    }
}